package com.example.use_interface2do_filter.myinterface;

import com.example.use_interface2do_filter.domain.Banner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @ClassName BannerRule1
 * @Description
 * @Author huyingliang
 * @Date 2024-02-20 15:27
 */
@Component
@Order(2)
public class BannerRule3 implements BannerConfig {

    @Override
    public List<Banner> doFilter(List<Banner> bannerList) {
        /*如果广告类型是 1 那么放行*/
        return bannerList.stream().filter(banner -> banner.getType().equals(1)).collect(Collectors.toList());
    }
}
